import type { RoleBatchMenuIdParams } from '@/types'

const controller = getAjaxBaseUrl('/sysRoleMenu')

/** 根据角色ID查询绑定的菜单ID列表用于回显 */
export function queryBindMenuId(roleId: number) {
  return get<number[]>(`${controller}/loadByRoleMenuList`, {
    roleId,
  })
}

/** 角色绑定菜单 */
export function batchMenuId(params: RoleBatchMenuIdParams) {
  return post(`${controller}/batchByRoleMenu`, params)
}
